/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sabatec.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Daniel.Morais
 */
@Entity
@Table(name = "usersabatec")
@NamedQueries({
    @NamedQuery(name = "UserSabatec.findAll", query = "SELECT u FROM UserSabatec u"),
    @NamedQuery(name = "UserSabatec.findUserPass", query = "SELECT u FROM UserSabatec u WHERE u.user= :userSabatec and u.senha= :senhaSabatec"),
    @NamedQuery(name = "UserSabatec.findId", query = "SELECT u FROM UserSabatec u WHERE u.id=:idSabatec")
})
public class UserSabatec implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "user")
    private String user;
    @Basic(optional = false)
    @Column(name = "senha")
    private String senha;

    public UserSabatec() {
    }

    public UserSabatec(Integer id) {
        this.id = id;
    }

    public UserSabatec(Integer id, String user, String senha) {
        this.id = id;
        this.user = user;
        this.senha = senha;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserSabatec)) {
            return false;
        }
        UserSabatec other = (UserSabatec) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.sabatec.UserSabatec[ id=" + id + " ]";
    }
    
}
